package servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import entity.Student;
import service.StudentService;
import service.serviceImpl.StudentServiceimpl;

/**
 * Servlet implementation class SellctallServlet
 */
@WebServlet("/SelectallServlet")
public class SelectallServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public SelectallServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		StudentService ser= new StudentServiceimpl();
		List<Student> list=ser.selectAll();
		req.setAttribute("list", list);
		req.removeAttribute("id");
		req.setAttribute("id", 1);
		req.getRequestDispatcher("/admin.jsp").forward(req, resp); 
	}
		
	}


